package cc.lzmsh.mapper;

import cc.lzmsh.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * Author:   wck
 * Date:     2024/9/25 下午2:35
 * Description:
 */

@Mapper
public interface UserMapper {
    @Insert("insert into user(username,password,create_time,update_time) values (#{username},#{password},now(),now())")
    void insertUser(User user);

    @Select("select * from user where username=#{username}")
    User selectUserByUsername(String username);


    void updateUserInfo(User user);

    @Update("update user set password=#{newPwd}")
    void updatePwd(String newPwd);
}
